package com.electronicmallapiidea.controller;

import com.electronicmallapiidea.annotation.Authority;
import com.electronicmallapiidea.common.Result;
import com.electronicmallapiidea.entity.AuthorityType;
import com.electronicmallapiidea.entity.Carousel;
import com.electronicmallapiidea.entity.User;
import com.electronicmallapiidea.service.CarouselService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/carousel")
public class CarouselController {
    public User getUser(){
        return null;
    }

    @Resource
    public CarouselService carouselService;

    /*
    查询
     */
//    @ApiOperation("")
    @GetMapping
    public Result findById(@PathVariable Long id)
    {
        return Result.success(carouselService.getById(id));
    }

    /*
    保存
     */
    @PostMapping
    @Authority(AuthorityType.requireAuthority)
    public Result save(@RequestBody Carousel carousel){

        return Result.success();
    }
}
